<!--启动页-->
<template>
	<view class="wrap">
		<view class="u-text-center u-padding-">
			<view style="height: 15vh;"></view>
			<u-icon name="copy" size="290" :custom-prefix="'el-icon-if'" color="#55aaff"></u-icon>
			<view style="margin-top: 150rpx;font-family:Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
				font-size: 66rpx;color:#55aaff ;">
				哈密消防多维处置平台
			</view>
			<view style="position: fixed;bottom: 20px;left: 0;right: 0;margin:0 auto;color: #8F8F94;">
				&copy; 2021
			</view>
		</view>
	</view>
</template>

<script>
	import utils from "../utils/utils.js"
	import { mapGetters,mapState } from 'vuex';
	export default {
		data() {
			return {
				
			}
		},
		onShow(){
			let token = utils.getStorageSync("authorization");
			var count = 3;
			let _this = this;
			setInterval(function(){
			    count--;
				if(count == 0){
					_this.initViews(token)
				}
			},1000)
		},
		methods: {
			initViews(val){
				if(!val){
					uni.redirectTo({
						url:"/pages/login/index"
					})
				}
				this.utils.request("/api/app/user/getUserInfo", {}, "get", "app", true).then(res => {
					if(res.data.roleCode == "XZ-ADMIN" || res.data.roleCode == "XZ-YH"){
						//消灾企业用户
						uni.redirectTo({
							url:"/pages/index/index_xz"
						})
					} else if(res.data.roleCode == "WB-ADMIN" || res.data.roleCode == "WB-YH"){
						//维保企业用户
						uni.redirectTo({
							url:"/pages/index/index_wb"
						})
					}else if(res.data.roleCode == "JC-ADMIN" || res.data.roleCode == "JC-YH"){
							//维保企业用户
						uni.redirectTo({
							url:"/pages/index/index_jc"
						})
					}else{
						//其他企业用户
						uni.redirectTo({
							url:"/pages/index/index_qt"
						})
					}
				}).catch(error => {
					console.log(error)
				})
			}
		}
	}
</script>

<style>

</style>
